package com.ws.gold.controller;

import com.ws.gold.domain.AiAnalysis;
import com.ws.gold.service.AiAnalysisService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ws
 * @create 2025/6/29
 */

@RestController
@RequiredArgsConstructor
@RequestMapping("/ai-analysis")
public class AiAnalysisController {

    private final AiAnalysisService aiAnalysisService;

    /**
     * 查询最新分析的内容
     */
    @RequestMapping("/getAiData")
    public String getAiData() {
        return aiAnalysisService.lambdaQuery().orderByDesc(AiAnalysis::getCreateTime).list().get(0).getContent();
    }

}
